package com.origin.app.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.origin.app.bean.ABean;
import com.origin.app.bean.TestBean;
import com.origin.app.bean.UserProtectionAddressBean;

import com.origin.app.greendao.ABeanDao;
import com.origin.app.greendao.TestBeanDao;
import com.origin.app.greendao.UserProtectionAddressBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig aBeanDaoConfig;
    private final DaoConfig testBeanDaoConfig;
    private final DaoConfig userProtectionAddressBeanDaoConfig;

    private final ABeanDao aBeanDao;
    private final TestBeanDao testBeanDao;
    private final UserProtectionAddressBeanDao userProtectionAddressBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        aBeanDaoConfig = daoConfigMap.get(ABeanDao.class).clone();
        aBeanDaoConfig.initIdentityScope(type);

        testBeanDaoConfig = daoConfigMap.get(TestBeanDao.class).clone();
        testBeanDaoConfig.initIdentityScope(type);

        userProtectionAddressBeanDaoConfig = daoConfigMap.get(UserProtectionAddressBeanDao.class).clone();
        userProtectionAddressBeanDaoConfig.initIdentityScope(type);

        aBeanDao = new ABeanDao(aBeanDaoConfig, this);
        testBeanDao = new TestBeanDao(testBeanDaoConfig, this);
        userProtectionAddressBeanDao = new UserProtectionAddressBeanDao(userProtectionAddressBeanDaoConfig, this);

        registerDao(ABean.class, aBeanDao);
        registerDao(TestBean.class, testBeanDao);
        registerDao(UserProtectionAddressBean.class, userProtectionAddressBeanDao);
    }
    
    public void clear() {
        aBeanDaoConfig.clearIdentityScope();
        testBeanDaoConfig.clearIdentityScope();
        userProtectionAddressBeanDaoConfig.clearIdentityScope();
    }

    public ABeanDao getABeanDao() {
        return aBeanDao;
    }

    public TestBeanDao getTestBeanDao() {
        return testBeanDao;
    }

    public UserProtectionAddressBeanDao getUserProtectionAddressBeanDao() {
        return userProtectionAddressBeanDao;
    }

}
